﻿@model IEnumerable<MVC01.Models.Product>
@{
    ViewBag.Title = "ProductbyCategory";
}
<script type="text/javascript">
    $(document).ready(function () {
        $('@(ViewBag.CatSelected)').addClass("active");
    });  
</script>
<div class="products">    
    <div class="cl">
        &nbsp;</div>
    <ul>
        @{
            int i = 1;
            foreach (var item in Model)
            {
                string clsBreak = (i % 3) == 0 ? "break" : "";
                string imgid = string.Concat("productdetail", item.ProductId);

                string imgPath = item.MainImage;
                imgPath = @Url.Content("~/Content/images/" + imgPath);
            <li class='@clsBreak'><a class="openDialog" href="@Url.Action("ProductDetail", "Home", new { pid = item.ProductId, cid = ViewBag.LoadMoreProduct })" data-dialog-title="Chi tiết sản phẩm"
                    data-dialog-id="aboutlDialog">
                <img src='@imgPath' alt="" height="383px" width="231px" /></a>
                @if (item.IsPromotion == true)
                {
                    <div class="promotion">
                        <p>
                            -@item.SaleOffPercent%</p>
                    </div>
                }
                <div class="product-info">
                    <h3>
                        @item.Name
                    </h3>
                    <div class="product-desc">
                        <h4>
                            @item.Description
                        </h4>
                        <strong class="price">@string.Format("{0:0,0}", item.Price)
                            VNĐ</strong>
                    </div>
                </div>
            </li>
                i++;
            }
        }
    </ul>
    <div class="cl">
        &nbsp;</div>
</div>
